Computer and Modernization ›› 2011, Vol. 1 ›› Issue (4): 29-31.doi: 10.3969/j.issn.1006-2475.2011.04.009

• 数据库 • Previous Articles     Next Articles

Research on Method of Export Data into Excel in C#.NET

SU Qing, LI Zhong-liang, WU Wei-min   

  1. Visualization in Scientific Computing Laboratory, Faculty of Computer, Guangdong University of Technology, Guangzhou 510006, China
  • Received:2010-12-07 Revised:1900-01-01 Online:2011-04-27 Published:2011-04-27

Abstract: In C# .NET, the commonly method of export the data in the component of DataGridView into Excel uses the Excel’s COM component to achieve it. But because the vision of Excel between the development machine and user’s machine installed maybe different, this method often leads to the phenomenon of incompatible. To solve this problem, the reflection technique is proposed to implement the interaction of C# and Excel. Through the experiment on the computer with different visions of Excel, the results show that this method can solve the problem of version compatibility very well. 

Key words: reflection, COM component, Excel

CLC Number: